package chapter2.observerMode;

import chapter2.observerMode.observable.impl.ClockObservable;
import chapter2.observerMode.observable.impl.JDKObservable;
import chapter2.observerMode.observer.impl.FullTimePlate;
import chapter2.observerMode.observer.impl.OnlyTimePlate;

import java.time.LocalDateTime;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class Main {
    public static void main(String[] args){
//        ClockObservable observable = new ClockObservable();
//        FullTimePlate obj = new FullTimePlate(observable);
        JDKObservable o = new JDKObservable();
        OnlyTimePlate b = new OnlyTimePlate(o);


        Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(o::change, 0, 2, TimeUnit.SECONDS);
    }
}
